package com.dba.example.gwt.client.views.impl;

import com.dba.example.gwt.client.views.HomeView;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class HomeViewImpl extends Composite implements HomeView {

	@SuppressWarnings("unused")
	private Presenter presenter;
	
	interface DefaultUiBinder extends UiBinder<Widget, HomeViewImpl> {}

	private static DefaultUiBinder uiBinder = GWT.create(DefaultUiBinder.class);

	@UiField
	VerticalPanel log;
	
    public HomeViewImpl() {
    	initWidget(uiBinder.createAndBindUi(this));
    }

	public void setPresenter(Presenter presenter) {
		this.presenter = presenter;
	}
	
	@Override
	public void displayToken(String token) {
		log.add(new Label(token));
	}
	
}
